from frontend.roleApplication import RoleApplication
from frontend.form import Type
from vars import *



class InventoryMgrApplication(RoleApplication):

    def __init__(self):
        super(InventoryMgrApplication, self).__init__(WorkflowName, Role.InventoryMgr)
        # Here we use SINK step.  This lets the user choose a pre-existing record to work with from a queue on the left side
        self.register_transition_step(Step.CheckInventory, self.generic_middle_or_ending_role_form_creator, name_fields=['AddressName','PillowType','PillowQuantity'])
        
    def generic_middle_or_ending_role_form_creator(self, stepname, form):
        form.add_task_label(fields=['PillowType','PillowQuantity'])
        form.add_static_label('Please confirm whether the requested items are in stock:')
        form.add_field(Type.CHOICE, 'InStock',labeltext="In stock?", choices=['Yes', 'No'])

if __name__ == '__main__':
    app = InventoryMgrApplication()
    app.MainLoop()